<template>
  <div class="select-gender">
    <div @click="onSelect(1)" :class="['item', { active: value == 1 }]">
      <svg-icon icon-class="male"></svg-icon>
    </div>
    <div
      @click="onSelect(0)"
      :class="['item', { 'active-female': value == '0' }]"
    >
      <svg-icon icon-class="female"></svg-icon>
    </div>
  </div>
</template>
<script>
export default {
  name: "WorkspaceJsonSelectGender",
  mode: {
    prop: "value",
    event: "input",
  },
  props: {
    value: {
      default: "",
    },
  },
  data() {
    return {};
  },

  mounted() {},

  methods: {
    onSelect(type) {
      this.$emit("input", type);
    },
  },
};
</script>

<style lang="scss" scoped>
.select-gender {
  display: flex;
  font-size: 24px;
  position: relative;
  top: 2px;
  .item {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    background: #f5f5f5;
    margin-right: 10px;
    padding: 2px 0;
    &:nth-child(2) {
      font-size: 26px;
    }
    span {
      font-size: 16px;
    }
  }
  .active {
    color: #409eff;
    // background: #d9ecff;
    background-color: #ecf5ff;
  }
  .active-female {
    color: rgb(249, 167, 181);
    background-color: rgb(250, 245, 246);
  }
}
</style>
